package com.settlement.system.service;

import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.TblRrRecordProjectMain;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * 收退款-记账项目主表 服务类
 *
 * @author Ximi
 * @since 2020-07-14
 */

public interface ITblRrRecordProjectMainService extends IBaseService {

    /**
     * 根据记账项目获取记账项目
     *
     * @param recordAccountProject 记账项目
     * @return
     * @throws ServiceException
     */
    @Cacheable("rrRecordProject")
    public List<TblRrRecordProjectMain> getByRecordAccountProject(String recordAccountProject) throws ServiceException;

    @Cacheable("getByChannelNoAndBillTypeAndOriginBillProject")
    String getByChannelNoAndBillTypeAndOriginBillProject(String channelNo, String billType, String originBillProject) throws ServiceException;

    TblRrRecordProjectMain getByChannelNoAndBillTypeAndNotBillCategory(String channelNo, String billType, String notBillCategory) throws ServiceException;

    TblRrRecordProjectMain getByChannelNoAndBillTypeAndNotBillCategory(String channelNo,
                                                                       String billType,
                                                                       String notBillCategory,
                                                                       String notId) throws ServiceException;

    /**
     * 根据记账项目,获取不重复的凭证类型
     *
     * @param recordAccountProject 记账项目
     * @param channelNo 渠道编码
     * @param billType 账单类型（仅渠道为优购时加入判断条件）
     * @throws ServiceException
     * @return
     */
    @Cacheable("getUnrepeatableVoucherTypes")
    public List<TblRrRecordProjectMain> getUnrepeatableVoucherTypes(String recordAccountProject,String channelNo,String billType) throws ServiceException;

    /**
     * 根据记账项目,获取是否参与记账
     *
     * @param recordAccountProject 记账项目
     * @param channelNo 渠道编码
     * @param billType 账单类型
     * @return
     */
    String getIsJoinRecordAccount(String recordAccountProject, String channelNo, String billType) throws ServiceException;

    /**
     * 根据记账项目和渠道编码,获取收费项目
     * @param recordAccountProject 记账项目
     * @param channelNo 渠道编码
     * @return
     * @throws ServiceException
     */
    @Cacheable(value = "getChargeProjectByRecordAccountProject")
    public String getChargeProjectByRecordAccountProject(String recordAccountProject,String channelNo) throws ServiceException;

    List<TblRrRecordProjectMain> selectByParams(TblRrRecordProjectMain tblRrRecordProjectMain) throws ServiceException;
}

